package ar.edu.unlp.info.tesis.database;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BDUtils {

	private static SessionFactory sessionFactory;
	
	@Autowired
	public void setSessionFactory(SessionFactory sessionFactory) {
		BDUtils.sessionFactory = sessionFactory;
	}

	public static Session getSession(){
		return BDUtils.sessionFactory.getCurrentSession();
	}
}
